using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace XiaoMan.Model.Models.Mapping
{
    public class Sys_RegionMap : EntityTypeConfiguration<Sys_Region>
    {
        public Sys_RegionMap()
        {
            // Primary Key
            this.HasKey(t => t.CodeID);

            // Properties
            this.Property(t => t.CodeID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.Name)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Sys_Region");
            this.Property(t => t.CodeID).HasColumnName("CodeID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.ParentID).HasColumnName("ParentID");
        }
    }
}
